const landDom = document.querySelector(".land")
const landStyles = getComputedStyle(landDom)
const landWidth = parseFloat(landStyles.width)
const landHeight = parseFloat(landStyles.height);
const landTop = parseFloat(landStyles.top);


// console.log(landWidth, landHeight);



class Land extends Rectangle {
    constructor(speed) {
        super(landWidth, landHeight, 0, landTop, speed, 0, landDom)
    }


    onmove() {
        //判断边界值
        if (this.left < - landWidth / 2) {
            this.left = 0
        }
    }


}



// const land = new Land(-100)


// setInterval(() => {
//     land.move(16 / 1000)
// }, 16)









/**
 * 我自己的总结：
 *  landDom.style.width 只能赋值，不能获取属性
 */




